Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logsoftmax with dims #135

Merged
merged 4 commits into from
Sep 27, 2019
Merged

logsoftmax with dims #135

merged 4 commits into from
Sep 27, 2019

Conversation

mcabbott
Copy link
Member

For #77, this adds a version of logsoftmax which takes dims keyword, and ∇logsoftmax too.

It also adjusts the implementation for softmax from #130 so as not to exponentiate twice; this is about twice as fast, see #77 (comment) .

Both of these mutate their out array, which could easily be avoided if desired, at the cost of twice the memory.

@codecov-io
Copy link

codecov-io commented Sep 26, 2019

Codecov Report

Merging #135 into master will decrease coverage by 1.29%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #135     +/-   ##
=========================================
- Coverage   79.03%   77.73%   -1.3%     
=========================================
  Files          24       24             
  Lines         763      768      +5     
=========================================
- Hits          603      597      -6     
- Misses        160      171     +11
Impacted Files Coverage Δ
src/softmax.jl 27.02% <88.88%> (-22.98%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 342928e...8677b1a. Read the comment docs.

@MikeInnes
Copy link
Member

It would be best to avoid in-place operations, since these are designed to be AD-compatible. Otherwise it looks good.

@mcabbott
Copy link
Member Author

OK, done.

@MikeInnes
Copy link
Member

Perfect, thanks a lot!

@MikeInnes MikeInnes merged commit 5998b47 into FluxML:master Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants